package com.example.buildermode.two;

/**
 * @version 1.0.0
 * @className: HouseDirector
 * @description:
 * @author: zhangjunfa
 * @date: 2022/6/12 10:43
 */
public class HouseDirector {

    private HouseBuilder houseBuilder = null;

    public HouseDirector() {
    }

    public HouseBuilder getHouseBuilder() {
        return houseBuilder;
    }

    public void setHouseBuilder(HouseBuilder houseBuilder) {
        this.houseBuilder = houseBuilder;
    }

    //如何处理建造房子的流程，交给指挥者
    public House constructorHouse() {
        houseBuilder.buildBasis();
        houseBuilder.buildWalls();
        houseBuilder.roofed();
        return houseBuilder.buildHouse();
    }
}
